<?php global $glow_catnum_posts, $glow_grab_image; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php elegant_titles(); ?></title>
<?php elegant_description(); ?> 
<?php elegant_keywords(); ?> 
<?php elegant_canonical(); ?>
<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
<?php wp_head(); ?>

<link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/style.css" type="text/css" media="screen" />
<!--[if lt IE 7]>
	<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory'); ?>/ie6style.css" />
	<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/DD_belatedPNG_0.0.8a-min.js"></script>
	<script type="text/javascript">DD_belatedPNG.fix('#page-menu ul, ul#page-menu li li,#page-menu li li a:hover, ul#page-menu li.current_page_item li a:hover, #cats-menu ul, div#container-top, #featured-area .pics span.feat-overlay, #featured-area .pics div.excerpt, .new-post div.date, .mainpost-wrap div.date, div#footer, ul#cats-menu li li a, .bubble,.reply-container');</script>
<![endif]-->
<!--[if IE 7]>
	<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory'); ?>/ie7style.css" />
<![endif]-->

<?php if (get_option('glow_color_scheme') <> 'Purple') { ?>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/style-<?php echo(get_option('glow_color_scheme'));?>.css" type="text/css" media="screen" />
<?php }; ?>

<?php if (get_option('glow_child_css') == 'on') { //Enable child stylesheet  ?>
<link rel="stylesheet" href="<?php echo(get_option('glow_child_cssurl')); ?>" type="text/css" media="screen" />
<?php }; ?>

<?php if (get_option('glow_custom_colors') == 'on') { //Enable custom colors  ?>
<style type="text/css">
	body { color: #<?php echo(get_option('glow_color_mainfont')); ?>; }
	body { background-color: #<?php echo(get_option('glow_color_bgcolor')); ?>; }
	a:link, a:visited, .post a { color: #<?php echo(get_option('glow_color_mainlink')); ?>; }
	ul#page-menu li a, ul#page-menu li li a, ul#page-menu li.current_page_item li a, ul#page-menu li.current_page_parent li.current_page_item a { color: #<?php echo(get_option('glow_color_pagelink')); ?>; }
	ul#cats-menu li a { color: #<?php echo(get_option('glow_color_catslink')); ?>; }
	#sidebar h3.sidebar-title { color:#<?php echo(get_option('glow_color_sidebar_titles')); ?>; }
	#sidebar h3.sidebar-title { background-color:#<?php echo(get_option('glow_color_sidebar_bgtitles')); ?>; }
	a.comment-reply-link { color:#<?php echo(get_option('glow_color_reply')); ?>; }
	.sidebar-block a, #sidebar div.custom-sidebar-block div.content a { color:#<?php echo(get_option('glow_color_sidebar_link')); ?>; }
	.new-post h1 { color:#<?php echo(get_option('glow_color_heading')); ?>; }
</style>
<?php }; ?>

<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

<script type="text/javascript">
	document.documentElement.className = 'js';
</script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/jquery.easing.1.3.js"></script>	
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/superfish.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/init.js"></script>
<?php if ((is_home()) && (get_option('glow_featured') == 'on') ) { //scripts for featured area are loaded only on homepage / when Display Featured Articles is set to Display ?>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/jquery.cycle.all.min.js"></script>
<script type="text/javascript">
//<![CDATA[
	jQuery(function(){
		var $featured_area = jQuery('#featured-area');
		var $featured_item = jQuery('#featured-area div#slider-control div.featitem');
		var $slider_control = jQuery('#featured-area div#slider-control');
		var $image_container = jQuery('div#s1 > div');
		var ordernum;
		var pause_scroll = false;
			
		$featured_item.find('img').fadeTo("fast", 0.7);
		$slider_control.find("div.featitem.active img").fadeTo("fast", 1);
		$image_container.css("background-color","#000000");
		
		$image_container.hover(
			function () {
				jQuery(this).find("img").fadeTo("fast", 0.7);
			}, 
			function () {
				jQuery(this).find("img").fadeTo("fast", 1);
			}
		);
<?php if (get_option('glow_pause_hover') == 'on') { ?>				
		$featured_area.mouseover(function(){
			pause_scroll = true;
		}).mouseout(function(){
			pause_scroll = false;
		});
<?php }; ?>		
		function gonext(this_element){
			$slider_control.find("div.featitem.active img").fadeTo("fast", 0.7);
			$slider_control.find("div.featitem.active").removeClass('active');
			this_element.addClass('active');
			$slider_control.find("div.featitem.active img").fadeTo("fast", 1);
			ordernum = this_element.find("span.order").html();
			jQuery('#s1').cycle(ordernum - 1);
		} 
		
		$featured_item.click(function() {
			clearInterval(interval);
			gonext(jQuery(this)); 
			return false;
		});
		
		var auto_number;
		var interval;
		
		$featured_item.bind('autonext', function autonext(){
			if (!(pause_scroll)) gonext(jQuery(this)); 
			return false;
		});

<?php if (get_option('glow_slider_auto') == 'on') { ?>
		interval = setInterval(function () {
			auto_number = $slider_control.find("div.featitem.active span.order").html();
			if (auto_number == $featured_item.length) auto_number = 0;
			$featured_item.eq(auto_number).trigger('autonext');
		}, <?php echo(get_option('glow_slider_autospeed')); ?>);
<?php } ?>
	});
//]]>	
</script>

<script type="text/javascript">
jQuery(function(){
	jQuery('#s1').cycle({
		timeout: 0, 
		speed: 300,
		fx: '<?php echo(get_option('glow_slider_effect')); ?>'
	});
<?php if (get_option('glow_disable_toptier') == 'on') echo('jQuery("ul.nav > li > a > span.sf-sub-indicator").parent().attr("href","#")'); ?>
});
</script>

<?php }; ?>

<?php if (get_option('glow_integration_head') <> '' && get_option('glow_integrate_header_enable') == 'on') echo(get_option('glow_integration_head')); ?>

</head>
<body <?php if (is_home()) echo('id="home"');?>>
	<div id="header">
		<div class="container">
			<!-- Page Menu -->
			<?php if (get_option('glow_menupages') <> '') $include_pages = implode(",", get_option('glow_menupages')); 
				  $include_cats = implode(",", get_option('glow_menucats'));
				  $strdepth = '';
				  if (get_option('glow_categories_empty') == 'on') $hide = '1';
				  if (get_option('glow_categories_empty') == 'false') $hide = '0';
				  if (get_option('glow_enable_dropdowns') == 'on') $strdepth = "depth=".get_option('glow_tiers_shown_pages');
				  if ($strdepth == '') $strdepth = "depth=1";
				  $strdepth2 = '';
				  if (get_option('glow_enable_dropdowns_categories') == 'on') $strdepth2 = "depth=".get_option('glow_tiers_shown_categories');
				  if ($strdepth2 == '') $strdepth2 = "depth=1"; ?>
			<ul id="page-menu" class="superfish nav">
				<?php if (get_option('glow_swap_navbar') == 'false') { ?>
                <?php if (get_option('glow_home_link') == 'on') { ?>
					<li <?php if (is_home()) echo('class="current_page_item"') ?>><a href="<?php bloginfo('url'); ?>">Home</a></li>
                <?php }; ?>
					<?php wp_list_pages("sort_column=".get_option('glow_sort_pages')."&sort_order=".get_option('glow_order_page')."&".$strdepth."&include=".$include_pages."&title_li="); ?>
				<?php } else { ?>
					<?php wp_list_categories("orderby=".get_option('glow_sort_cat')."&order=".get_option('glow_order_cat')."&".$strdepth."&include=".$include_cats."&hide_empty=".$hide."&title_li="); ?>
				<?php } ?>
			</ul> <!-- end page menu -->
			
			<div class="clear"></div>
			
			<!-- Logo -->
			<a href="<?php bloginfo('url'); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/logo.png" alt="logo" id="logo" /></a>
			
			<div class="clear"></div>
			<!-- Categories Menu -->
			<ul id="cats-menu" class="superfish nav">
				<?php if (get_option('glow_swap_navbar') == 'false') { ?>
					<?php wp_list_categories("orderby=".get_option('glow_sort_cat')."&order=".get_option('glow_order_cat')."&".$strdepth2."&include=".$include_cats."&hide_empty=".$hide."&title_li="); ?>
				<?php } else { ?>
                	<?php if (get_option('glow_home_link') == 'on') { ?>
						<li <?php if (is_home()) echo('class="current_page_item"') ?>><a href="<?php bloginfo('url'); ?>">Home</a></li>
                    <?php }; ?>
					<?php wp_list_pages("sort_order=".get_option('glow_order_page')."&".$strdepth."&include=".$include_pages."&title_li="); ?>
				<?php } ?>
			</ul> <!-- end categories menu -->
		</div> <!-- end container -->
	</div> <!-- end header -->
	
	<div id="content">
		<div id="container-top"></div>
		<div class="container">